import { request } from '../request';

/**
 * 购买游戏
 * @param purchaseData 购买数据
 */
export function purchaseGame(purchaseData: { userId: number; gameId: number }) {
  return request({
    url: '/api/purchase/game.do',
    method: 'post',
    data: purchaseData
  });
}

/**
 * 批量购买游戏
 * @param batchData 批量购买数据
 */
export function batchPurchaseGames(batchData: { userId: number; gameIds: number[] }) {
  return request({
    url: '/api/purchase/batch.do',
    method: 'post',
    data: batchData
  });
}

/**
 * 获取购买历史
 * @param userId 用户ID
 * @param page 页码
 * @param size 每页大小
 */
export function getPurchaseHistory(userId: string, page: number = 1, size: number = 10) {
  return request({
    url: '/api/purchase/history.do',
    method: 'get',
    params: { userId, page, size }
  });
} 